﻿using Newtonsoft.Json;
using QQZiFramework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QQZiFramework.Modals
{  /// <summary>
   /// 消息
   /// </summary>
    [DBTable(TableName = "A1_Messages")]
    public class BaseMessage : IDBEntity
    {
        [DBField(Usage = DBFieldUsage.PrimaryKey)]
        public int Id { get; set; }
        /// <summary>
        /// 消息标题
        /// </summary>
        public string Title { get; set; }

        /// <summary>
        /// 消息内容
        /// </summary>
        public string Content { get; set; }

        /// <summary>
        /// 消息连接
        /// </summary>

        public string Href { get; set; }


        /// <summary>
        /// 发送人，系统的则为空
        /// </summary>
        public int? FromUserId { get; set; }
        /// <summary>
        /// 接受人
        /// </summary>
        public int ToUserId { get; set; }
        /// <summary>
        /// 消息发送时间
        /// </summary>
        [JsonConverter(typeof(QQZiFramework.UnixDateConverter))]
        public DateTime CreateTime { get; set; }
        /// <summary>
        /// 接受的角色
        /// </summary>
        public int ToRoleID { get; set; }

        /// <summary>
        /// 0：未读，1：已读
        /// </summary>
        public int Status { get; set; }

        /// <summary>
        /// 前台：1，后台:2
        /// </summary>
        public int PlatformId { get; set; }


        /// <summary>
        /// 清除标志，可通过它来标记已读(用在任务真正被完成时手动标记该消息，比如运营平台的提醒)
        /// </summary>
        public string ClearFlag { get; set; }

        /// <summary>
        /// 超期自动标记为已读
        /// </summary>
        public DateTime ValidityDate { get; set; }

        /// <summary>
        /// 分类Id
        /// </summary>
        [DBField(IncludeOEMS="SHM,XZB")]
        public int? CategoryId { get; set; }
    }
}
